package com.hzxy.yiyid.web.module.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzxy.yiyid.web.module.repository.entity.FoodRecommend;
import com.hzxy.yiyid.web.module.repository.entity.FoodType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FoodTypeMapper extends BaseMapper<FoodType> {
    @Select("select f.id,f.food_type_id,f.food_calorie,f.food_name,f.gross_calorie,f.pic,f.create_time from food_recommend f ,food_type t where f.food_type_id = t.id and t.id = #{foodTypeId} LIMIT 0,3")
    List<FoodRecommend> getFoodIdByFoodtype(Integer foodTypeId);

    @Select("SELECT f.id,f.food_type_id,f.food_calorie,f.food_name,f.gross_calorie,f.pic,f.create_time FROM food_recommend f WHERE food_type_id = #{foodTypeId} LIMIT 3,3")
    List<FoodRecommend> getFoodByBtnidThree(Integer foodTypeId);

    @Select("SELECT f.id,f.food_type_id,f.food_calorie,f.food_name,f.gross_calorie,f.pic,f.create_time FROM food_recommend f WHERE food_type_id = #{foodTypeId} LIMIT 6,3")
    List<FoodRecommend> getFoodByBtnidSix(Integer foodTypeId);

    @Select("SELECT f.id,f.food_type_id,f.food_calorie,f.food_name,f.gross_calorie,f.pic,f.create_time FROM food_recommend f WHERE food_type_id = #{foodTypeId} LIMIT 0,3")
    List<FoodRecommend> getFoodByBtnidZero(Integer foodTypeId);
}
